package ny.com.baoxian;

public class Car extends Bx {
    private int number;
    private double price;
    private double money;
    public  Car(int number,double price){
        this.number=number;
        this.price=price;
    }
    @Override
    public double add() {
        if (number==0){
            money=price*0.02;

        }
        return money;
    }
    public  int getNumber(){
        return number;
    }
    public void setNumber(int number){
        this.number=number;
    }
    public double getPrice(){
        return price;
    }
}
